<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>外边距</title>
    <style>
        body{
            margin: 0;
        }
        .box{
            width: 300px;
            height: 300px;
            border: 10px solid;
        }

        .box1{
            margin-bottom: 100px;
        }
        .box2{
            /* 上 右 下 左 */
            /* margin: 10px 20px 30px 40px; */
            /* margin: 10px 20px 30px; */
            /* margin: 10px 20px; */
            /* margin: 10px; */

            /* 横向居中显示 */
            /* margin: auto; */
            margin-top: 50px;

            padding: 20px;
            box-sizing: border-box;
        }

    </style>
</head>
<body>
    
    <div class="box box1"></div>
    <div class="box box2">
        内容
    </div>
    <div class="box box3"></div>
</body>
</html>